package com.itmuch.cloud.study.service.impl;

import com.itmuch.cloud.study.service.UserOptionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;

import java.util.UUID;

/**
 * Created by 齐丹枫 on 2017/3/9.
 */
@Service
public class UserOptionServiceImpl implements UserOptionService{

    @Autowired
    private JdbcTemplate jdbcTemplate;


    @Override
    public void saveUserOption(String user,String method,String delivery,String optionType) {
        StringBuffer sb = new StringBuffer(" INSERT INTO t_optionlog (id,userName,optionTime,method,delivery,optionType) " +
                "VALUES ('"+ UUID.randomUUID().toString() +"','"+user+"',NOW(),'"+method+"','"+delivery+"','"+optionType+"')");
        int count = jdbcTemplate.update(sb.toString());
    }
}
